<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core"> <ui:composition
	template="/Templates/Template.xhtml">

	<ui:define name="title">Authentification </ui:define>
	<ui:define name="contenu">
	<script type="text/javascript">
function noBack(){window.history.forward()}
noBack();
window.onload=noBack;
window.onpageshow=function(evt){if(evt.persisted)noBack()}
window.onunload=function(){void(0)}
</script>  
		<h:form id="form">
			<c:choose>
				<c:when test="#{loginBean.exist()==false}">
					<center> <div align="center" >
					<p:commandButton onclick="log.show()" value="Se Connecter"
						style="margin-top: 150px;" /> </div></center>
				</c:when>
				<c:otherwise>

				</c:otherwise>
			</c:choose>
			<p:growl id="growl" showDetail="true" life="3000" />
			<p:dialog id="boite" closable="true" hideEffect="explode"
				widgetVar="log" resizable="false" header="Authentification">
				<h:panelGrid columns="2" cellpadding="5">
					<h:outputLabel for="username" value="Username:"
						style="font-weight:400;" />
					<p:inputText value="#{loginBean.e.login}" id="username"
						required="true" label="username"
						requiredMessage="Veuillez saisir un nom d'utilisateur" />

					<h:outputLabel for="password" value="Password:"
						style="font-weight:400;" />
					<p:password value="#{loginBean.e.pass}" id="password"
						required="true" label="password"
						requiredMessage="Veuillez saisir un mot de passe" />

					<f:facet name="footer">
						<p:commandButton id="loginButton" value="Login"
							update=":form:boite growl" action="#{loginBean.login()}"
							onclick="boite.hide();" />
					</f:facet>
				</h:panelGrid>


			</p:dialog>
		</h:form>

	</ui:define>

</ui:composition> </html>